package cn.ggsaas.base.exception;

import cn.ggsaas.base.enums.EEnum;
import lombok.Getter;


/**
 * @author liyuzhen
 */
@Getter
public class BasicException extends RuntimeException {

    private int code;

    public BasicException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BasicException(String message) {
        super(message);
        this.code = 999;
    }

    public BasicException(EEnum eEnum) {
        super(eEnum.getValue());
        this.code = eEnum.getCode();
    }
}